<?php

class Story_Widget_CreateStoryTagController extends Engine_Content_Widget_Abstract
{

	public function indexAction()
	{
		$viewer = Engine_Api::_()->user()->getViewer();
		$this->view->can_create = Engine_Api::_()->authorization()->isAllowed('story', $viewer, 'create');

		if (!$this->view->can_create) {
			return $this->setNoRender();
		}

		if( Engine_Api::_()->core()->hasSubject() ) {
			$story = Engine_Api::_()->core()->getSubject();
			if($story->canView(Story_Model_Category::STORY_THREAD)){
				return $this->setNoRender();
			}
		}
		// Create form
		$this->view->form = new Story_Form_Create_Tag();
		
		
	}

}
